package site.enjoyrun.mapper;

import org.apache.ibatis.annotations.*;
import site.enjoyrun.model.Order;
import site.enjoyrun.model.User;

import java.util.List;

@Mapper
public interface OrderMapper {
    @Select("SELECT * FROM er_order")
    List<Order> selectOrders();
    @Insert("INSERT INTO er_order(o_kilometers,o_pace,o_type,o_money,o_id,o_run_start_time,o_steps) VALUES('${oKilometers}','${oPace}','${oType}','${oMoney}','${oId}','${oRunStartTime}','${oSteps}')")
    int insertOrder(Order order);

    @Update("UPDATE er_order SET o_kilometers='${oKilometers}',o_pace='${oPace}',o_type='${oType}',o_money='${oMoney}',o_run_start_time='${oRunStartTime}',o_steps='${oSteps}' WHERE o_id='${oId}'")
    int updateOrder(Order order);
    @Delete("DELETE FROM er_order WHERE o_id='${oId}'")
    int deleteOrder(String oId);
}
